package org.example.old.impl;

//import jdk.nashorn.internal.runtime.logging.Logger;
//import org.apache.ibatis.logging.Log;
//import org.apache.ibatis.logging.LogFactory;
//import org.example.platform.common.exception.BusinessException;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import org.example.old.dto.SysDto;
import org.example.old.listener.DemoDataListener;
import org.example.old.mapper.SysDao;
import org.example.old.service.SysService;
import org.example.old.vo.SysVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


//@Logger
@Service
//@AllArgsConstructor
public class SysServiceImpl implements SysService {
    @Resource
    SysDao sysDao;
//    Log log = LogFactory.getLog(SysServiceImpl.class);

    @Override
    public List<SysVo> querInfoList() {
        List<SysVo> list = sysDao.querInfoList();
        return list;
    }

    @Override
    public List<SysDto> querList() {
        List<SysDto> list = sysDao.querList();

//        log.error("List:"+list.toString());
        return list;
    }

    @Override
    public List<SysDto> querList2(int pageNum, int pageSize) {
        return sysDao.querList2(pageNum,pageSize);
    }

    @Override
    public int queryCount() {
        return sysDao.queryCount();
    }

    @Override
    public void addUserList(SysDto sysDto) {
        sysDao.addUserList(sysDto);
    }

    @Override
    public void addUserList(List<SysDto> sysDto) {
        sysDao.addUserInfoList(sysDto);
    }

    @Override
    public String exception() {
//        throw new Exception("自定义异常");
        return null;
    }

    @SentinelResource("HelloWorld")
    public void helloWorld() {
        // 资源中的逻辑
        System.out.println("hello world");
    }
}
